var 小明 = new Pepole("小明")
function Pepole(name)
{
  this.name=name;
  this.age=1;
  this.say = function()
  {
    console.log("你好");
  }
  this.ask = function(someone,type){
    if(someone==this)
    {
      var arr1 =["体育","计算机","设计","会计"]
      var n = parseInt(Math.random() * 4)
      return arr1[n]
    }else{
      someone.teach(type)
    }
    
  }
  this.teach = function(type){
    switch(type)
    {
      case "情感":
        return "不合适"
      case "专业":
        return "计算机"
      default:
        return "随大流"
    }
  }  
}
var 明明 = 小明;
while(true)
{
    明明.age++
    if(明明.age==18)
    {
        break;
    }
}
//问问题
var theOthers = new Pepole("其他人")
var r = 小明.ask(theOthers,"专业")
明明.age++
明明.age++
 r = 小明.ask(小明,"专业")
console.log(r);
 r = 小明.ask(小明,"专业")
console.log(r);
 r = 小明.ask(小明,"专业")
console.log(r);
//


